define(function(require, exports, module) {
    "use strict";
    var $ = require("$"),
        app = require("dist/application/app"),
        config = app.config,
        method = app.method;
    $("#verCode").on("click", function() {
        var $this = $(this),
            path = $this.data("path"),
            js_username = $(".js_username").val();


        if ($this.closest('form').valid()) {
            $this.attr("disabled", "disabled");
            var max = 59000;
            $this.text("60秒后重新获取")
            var t1 = setInterval(function() {
                $this.text("{0}秒后重新获取".format(max / 1000))
                max -= 1000;
                if (max == 0) {
                    $this.text("获取短信验证码").removeAttr('disabled')
                    clearInterval(t1);
                };
            }, 1000)
            method.postd(path, function(d) {}, {
                username: js_username
            })
        };



    })
})
